package com.derbysoft.dswitch.adapter.ihg.dswitch3.service.handler;

import com.derbysoft.dswitch.adapter.ihg.common.domain.OperationType;
import com.derbysoft.dswitch.adapter.ihg.common.domain.TransactionLog;
import com.derbysoft.dswitch.remote.hotel.dto.HotelAvailRequest;

import java.util.Date;
import java.util.UUID;

/**
 * Created by: jason
 * Date: 2012-05-22
 */
public class HotelMultiAvailabilityHandler extends HotelAvailabilityHandler {
    @Override
    protected TransactionLog createTransactionLog(HotelAvailRequest request) {
        TransactionLog transactionLog = new TransactionLog();
        transactionLog.setId(UUID.randomUUID().toString());
        transactionLog.setTaskId(request.getHeader().getTaskId());
        transactionLog.setChannel(request.getHeader().getSource());
        transactionLog.setOperationType(OperationType.HOTEL_MULTI_AVAIL);
        transactionLog.setHotels(getHotels(request));
        transactionLog.setTimestamp(new Date());
        return transactionLog;
    }
}
